Question : Type 'Promise' is not assignable to type 'void | (() => void)'.
Answered by : embarrassed-echidna-ach0akx835am
useEffect(() => { const genRandomKey = async () => { console.log(await ecc.randomKey()) }; genRandomKey();
}, []);
Source : https://stackoverflow.com/questions/57238928/react-typescript-16-8-how-to-make-useeffect-async | Last Update : Tue, 20 Oct 20